#include "Tile.h"


Tile::Tile(string imagePath,int x,int y,int width,int height, Engine* e) : Entity(x,y,width,height,e)
{
	this->image = new Image(imagePath.c_str());
	this->image->load();
	this->myCollider = new TileCollider(this);
}


Tile::~Tile(void)
{
}

void Tile::draw(SDL_Surface * screen,SDL_Rect* camera)
{
	//Rect temp
	SDL_Rect rectT;
	rectT.x = posRect->x - camera->x;
	rectT.y = posRect->y - camera->y;
	rectT.w = posRect->w;
	rectT.h = posRect->h;

	 //Blit the surface
	SDL_BlitSurface( image->getImage(), NULL, screen, &rectT );
}
